#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__author__ = "Administrator"
__name__="index"
__date__="2016/7/12"
__time__="11:18"
"""
from threading import Thread
import time
def Foo(arg,v):
    for item in range(10):
        print item
        time.sleep(1)

print 'before'
# 创建线程
# 根据这个类创建一个对象，就是创建一个线程
t1 = Thread(target=Foo,args=(1,22,))

# 运行(不一定立即执行)
t1.setDaemon(True)  # 要在start()之前
t1.start()
t1.join(5)
print t1.isDaemon()
print t1.getName()  #线程名字
print 'after'
print 'after'
print 'after end'

